﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SkillWarning : MonoBehaviour
{
    private Material _Material = null;
    private float progress = 0.0f;

    private void Awake()
    {
        SpriteRenderer spriteRenderer = GetComponent<SpriteRenderer>();
        _Material = spriteRenderer.material;
        _Material.SetVector("_Center", transform.position);

        // 边界点
        Rect sprRect = spriteRenderer.sprite.rect;
        _Material.SetVector("_TSize", new Vector2(sprRect.width, sprRect.height));
    }
    public void UpdateProgress(float fProgress)
    {
        // material setFloat(fProgress);
    }


    private void Update()
    {
        progress += (Time.deltaTime);
        if(progress >= 1.0f) {
            progress = 0;
        }
        _Material.SetVector("_Center", transform.position);
    }
}
